import request from '@/utils/request'
import qs from 'qs'
let APP_ID = 'cli_a88ac70d07e9d00c'
export function get_files(params) {
    return request({
        url: "api/pc/get_files",
        method: "GET",
        params
    })
}
export function upload(userinfo, data) {
    let userinfostr = qs.stringify(userinfo)
    return request({
        url: `api/pc/upload?${userinfostr}`,
        method: "POST",
        data
    })
}

export function get_detile(params) {
    return request({
        url: "api/pc/get_detile",
        method: "GET",
        params
    })
}

export function curve_intersections(data) {
    return request({
        url: "api/pc/calculate/curve-intersections",
        method: "post",
        data
    })
}


export function horizontal_intersections(data) {
    return request({
        url: "api/pc/calculate/horizontal-intersections",
        method: "post",
        data
    })
}
export function points(data) {
    return request({
        url: "api/pc/calculate/points-v2",
        method: "post",
        data
    })
}

export function merge(data) {
    return request({
        url: "api/pc/merge",
        method: "post",
        data
    })
}

export function rename(params) {
    return request({
        url: "api/pc/rename",
        method: "post",
        params
    })
}
export function dataManageDel(filename,params) {
    return request({
        url: "api/pc/files/"+filename,
        method: "delete",
        params
    })
}

export function densest_accumulation_all(data) {
    return request({
        url: "api/da/densest_accumulation_all",
        method: "post",
        data
    })
}

export function get_config_parameters(params) {
    const url = encodeURIComponent(location.href.split("#")[0]);
    return request({
        url: "api/get_config_parameters?url="+url,
        method: "get",
        params
    })
}

 

export function app_access_token() {
    return request({
        url: "feishu/app_access_token",
        method: "get"
    })
}
export function access_token(data) {
    return request({
        url:`feishu/access_token`,
        method: "post",
        data
    })
}
export function getcode(url) {
    window.open(`https://open.feishu.cn/open-apis/authen/v1/index?app_id=${APP_ID}&redirect_uri=${encodeURIComponent(url)}`,'_self')
}
 

export function feishuUserAdd(data) {
    return request({
        url:`feishu/user/add`,
        method: "post",
        data
    })
}
export function feishuUserQuery(data) {
    return request({
        url:`feishu/user/query`,
        method: "post",
        data
    })
}

export function powderGuideAdd(data) {
    return request({
        url:`feishu/powderGuide/add`,
        method: "post",
        data
    })
}

export function powderGuideQuery(data) {
    return request({
        url:`feishu/powderGuide/query`,
        method: "post",
        data
    })
}



















